﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicData.Infrastrueturc.Interfaces
{
 /// <summary>
 /// 仓储
 /// </summary>
 /// <typeparam name="T">逻辑</typeparam>
    public interface IBaseReposiotry<T> where T : class
    {
        /// <summary>
        /// 上下文
        /// </summary>
        MyDbContext DB { get; }


        /// <summary>
        /// 获取全部
        /// </summary>
        /// <returns>返回集合</returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="t">实体</param>
        /// <returns>返回受影响的行数</returns>
        Task<int> AddAsync(T t);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="t">实体</param>
        /// <returns>返回受影响的行数</returns>
        Task<int> Update(T t);
    }
}
